The present invention relates to a sewing machine that moves an embroidery frame holding a work cloth and sews an embroidery pattern and to a computer program product that causes the sewing machine to sew the embroidery pattern.
Recently, sewing machines are known that can detect a size of an embroidery frame used when sewing. This type of sewing machine is provided with an embroidery machine, to which the embroidery frame is attached, that moves the embroidery frame in an X axis direction and a Y axis direction, and with a tiltable lever that detects the size of the embroidery frame. A shape of the embroidery frame is substantially a rectangular shape. In a state in which the tiltable lever has been caused to slide to a downward position, a position of a front portion of the embroidery frame is detected by driving the embroidery frame in the X axis direction until the front portion of the embroidery frame comes into contact with the tiltable lever. A position of a rear portion of the embroidery frame is detected by driving the embroidery frame in a negative direction of the X axis until the rear portion of the embroidery frame comes into contact with the tiltable lever. The size of the embroidery frame is determined based on the detected positions of the front portion and the rear portion of the embroidery frame.